Cosmos DB (1 / 62): You are designing an application that will use Azure Cosmos DB as its data store. The application will store data about customers and their orders. Each customer can have multiple orders, and you expect a high volume of read and write operations on the orders.
You want to ensure that the application can handle the expected load and that the data is distributed efficiently. You also want to ensure that the application can retrieve all orders for a specific customer as efficiently as possible.
How would you design the data model in Azure Cosmos DB to meet these requirements?
Answer:
A container can hold items with different schemas as long as they share the same partition key. By storing customers and their orders in the same container and using the customer ID as the partition key, you can ensure that all orders for a specific customer are stored in the same partition. This makes it efficient to retrieve all orders for a specific customer.
The other options are incorrect because they do not efficiently distribute the data or allow for efficient retrieval of all orders for a specific customer.